<?php
/**
 * $Id: default.php 3 2010-04-05 10:01:57Z webbochsant $
 *  @package	Joomla
 *  @author Daniel Eliasson
* 	@copyright	Copyright (C) 2010 Stilero. All rights reserved.
* 	@license	GNU/GPL, see LICENSE.php
* 	Joomla! is free software. This version may have been modified pursuant
* 	to the GNU General Public License, and as distributed it includes or
* 	is derivative of works licensed under the GNU General Public License or
* 	other free or open source software licenses.
*/

// no direct access
defined('_JEXEC') or die('Restricted access'); ?>

<?php 
//Load css to Joomla
$document =& JFactory::getDocument();
$cssurl="modules/mod_virtuemart_featureprod_xhtml/css/vm_featureprod_default.css";
$document->addStyleSheet($cssurl, "text/css", "screen");
?>

<div class="feature_products">
	<?php $i=1 ?>
	<?php foreach ($list as $item){?>
		<?php if($i==1){ ?>
		<div class="product_row">
		<?php } ?>
			<div class="product item<?php print $i; ?><?php print ($i==$params->get(products_per_row))?" lastrowitem":""; ?>">
				<a href="<?php print JRoute::_($item->link); ?>"><img src="<?php echo $item->image; ?>" /></a>
				<div class="productname"><a href="<?php print $item->link ?>"><?php echo $item->title ?></a></div>
				<?php if ($params->get('show_short_desc')==1){ ?>
				<div class="short_desc"><?php echo $item->short_desc ?></div>			
				<?php } ?>
				<?php if ($params->get('show_price')==1){ ?>
				<div class="productprice">
				<div class="current_price"><?php echo $item->current_price.$params->get('currency_symbol') ?></div>
				<?php if($item->current_price!=$item->old_price){?>
				<div class="old_price"><?php echo $item->old_price.$params->get('currency_symbol') ?></div>
				<?php }	?>
				</div>
				<?php } ?>
				<?php if(($params->get(show_addtocart)==1) ){ ?>
					<?php if( ($params->get(attributes_addtocart)==1) || $item->attribute=="") { ?>
					<div class="product_addtocart">
						<form action="<?php print JURI::base() ?>index.php" method="post" name="addtocart" id="addtocart_late<?php echo $i; ?>" class="addtocart_form">
						<input class="buy_button" value="<?php echo JText::_('BUY'); ?>" title="<?php echo JText::_('BUY'); ?>" type="submit">
						<input name="flypage" value="shop.flypage.tpl" type="hidden">
						<input name="category_id" value="0" type="hidden">
						<input name="Itemid" value="41" type="hidden">
						<input id="quantity<?php echo $i; ?>" name="quantity[]" value="1" type="hidden">
						<input name="product_id" value="<?php echo $item->product_id ?>" type="hidden">
						<input name="prod_id[]" value="<?php echo $item->product_id ?>" type="hidden">
						<input name="page" value="shop.cart" type="hidden">
						<input name="func" value="cartadd" type="hidden">
						<input name="option" value="com_virtuemart" type="hidden">
						<input name="set_price[]" value="" type="hidden">
						<input name="adjust_price[]" value="" type="hidden">
						<input name="master_product[]" value="" type="hidden">
						</form>
					</div>
					<?php } ?>
				<?php } ?>
				<div class="readmore"><a href="<?php print JRoute::_($item->link); ?>"><?php echo JText::_('MORE'); ?></a></div>
			</div>
		<?php if($i++==$params->get(products_per_row)){?>
		</div>
		<?php $i=1; ?>
		<?php } ?>
	<?php } ?>
	<?php if($i!=1){ ?>
	</div>
	<?php }?>
	<div id="featureprod_footer">	
		<?php if($params->get(producer_link)){ ?>
		<div class="producer"><a href="http://www.stilero.com" title="<?php print JText::_('VIRTUEEXT');?>" target="_blank"><?php print JText::_('VIRTUEEXT');?></a></div>
		<?php } ?>
	</div>
</div>